package com.meeting.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meeting.entity.BookingOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.meeting.model.dto.bookingorder.BookingOrderCreateRequest;
import com.meeting.model.dto.bookingorder.BookingOrderQueryRequest;
import com.meeting.model.vo.BookingOrderVO;
import jakarta.validation.Valid;

import java.text.ParseException;
import java.util.List;

/**
 * @author 25843
 * @description 针对表【booking_order(会议室预订订单表)】的数据库操作Service
 * @createDate 2025-04-19 12:54:48
 */
public interface BookingOrderService extends IService<BookingOrder> {

    LambdaQueryWrapper<BookingOrder> getQueryWrapper(BookingOrderQueryRequest queryRequest);

    /**
     * 退款
     * @param id 订单id
     * @return
     */
    boolean refund(Long id) throws ParseException;

    BookingOrderVO createOrder(@Valid BookingOrderCreateRequest createRequest,Long customerId) throws ParseException;

    Boolean payOrder(Long orderId,Long customerId,Integer paymentMethod) throws ParseException;

    BookingOrderVO getOrderDetail(Long orderId,Long customerId);

    Page<BookingOrderVO> getOrderList(long pageNum, long pageSize,Long customerId);

    void handleTimeoutOrders() throws ParseException;

    List<BookingOrderVO> getCancellableOrders(Long customerId);

    BookingOrderVO cancelOrder(Long orderId, Long customerId);

    BookingOrderVO refundOrder(Long orderId, Long customerId);

    void handleUsedOrders();

    boolean refuseRefund(Long id);
}
